import {defineStore} from 'pinia'

export {useRequestStore} from './modules/requestStore'
export {useUserStore} from './modules/userStore'
export {useDomainStore} from './modules/domainStore'

// 公共store
export const useMainStore = defineStore('main-store', {
  state: () => {
    return {
      theme: localStorage.getItem('theme') || 'light',
      isAddedRoute: false, // 是否已经添加路由
      commonImagePath: '/images/backstage-images/common-images',// 后台公共图片路径
      pagination: {
        pageSize: 10,
        pageSizes: [10, 20, 50, 100],
        showQuickJumper: true,
        suffix: () => '页',
        showSizePicker: true
      },
    }
  },
  getters: {},
  actions: {
    setIsAddedRoute(val) {
      this.isAddedRoute = val
    }
  }
})
